<?php
namespace houze;

/*
* 爬虫类
*/

class QueryList{
    // 静态对象
    public static function run($url=null, $data=null){
        if(empty($url)) return false;
        // HTTP客户端
        $client = new \houze\Client();
        // 设置URL GET获取页面内容
        if(empty($data)) {
            $html = $client->http()->domain($url)->get();
        }else{
            $html = $client->http()->domain($url)->body($data)->get();
        }
        if(empty($html)) return false;
        // DOM选择器
        $crawler = new \houze\reptile\Crawler($html);
        return $crawler;
    }
}

